# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-ipip-ipdb
pkgver=1.6.0
pkgrel=3
pkgdesc="IPIP.net officially supported IP database ipdb format parsing library"
url="https://github.com/ipipdotnet/ipdb-python"
license=('Apache')
arch=('any')
depends=('python')
makedepends=('python-setuptools')
conflicts=('python-ipdb')
source=("https://pypi.io/packages/source/i/ipip-ipdb/ipip-ipdb-$pkgver.tar.gz")
sha512sums=('88353892920e3c97a12417e52fcee23919f351d9dae22d5fbdba964d6fad528103e18b9fe736cc73208dad1a68ec59d7bc6f94d87772845985e3ca6f8b3a2860')

build() {
  cd ipip-ipdb-$pkgver
  python setup.py build
}

check() {
  cd ipip-ipdb-$pkgver
  # TODO: Switch to github source after https://github.com/ipipdotnet/ipdb-python/issues/7 is fixed
  # python ipdb_test.py
}

package() {
  cd ipip-ipdb-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
}
